

#ifndef GISCOREAO_STRUCT_H
#define GISCOREAO_STRUCT_H

#include <stdint.h>
#include <string>
#include <iostream>
#include "libc2c/byte_stream.h"
#include "app_platform/intf_service_object.h"
#include "erp/gis/po/shiptypeareagischeckpo_gis.h"	
#include "erp/gis/po/mergedcoordinatespo_gis.h"	
#include <map>	
#include <vector>	

namespace erp
{
namespace gis
{
namespace ao
{

	const uint32_t GISCOREAO_CHECKAREACOVER_REQ_CMD_ID = 0xc0221001; ///检测目标地址对应的配送方式是否被覆盖请求类  请求命令号
	const uint32_t GISCOREAO_CHECKAREACOVER_RESP_CMD_ID = 0xc0228001; ///检测目标地址对应的配送方式是否被覆盖返回类  回应命令号
	

	const uint32_t GISCOREAO_GETMERGECOORDINATE_REQ_CMD_ID = 0xc0221002; ///获取合并经纬度请求类  请求命令号
	const uint32_t GISCOREAO_GETMERGECOORDINATE_RESP_CMD_ID = 0xc0228002; ///获取合并经纬度返回类  回应命令号
	


const uint16_t GISCOREAO_MAX_PROTOCAL_VERSION = 2; //>平台支持的最大协议版本号


///////////////////////////// STRUCTS /////////////////////////////////////////////////
	/**
	 *
 	 * 检测目标地址对应的配送方式是否被覆盖请求类 
	 *
 	 * @date 2013-10-20 15:23:01
 	 * @version 0
	 */	
	struct CGisCoreAoCheckAreaCoverReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::gis::po::CShipTypeAreaGisCheckPo shipTypeAreaGisCheckPo;	
		std::string inReserve;
		std::map<uint32_t,uint32_t > CheckResult;
		std::string errMsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return GISCOREAO_CHECKAREACOVER_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > GISCOREAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			shipTypeAreaGisCheckPo.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 检测目标地址对应的配送方式是否被覆盖返回类 
	 *
 	 * @date 2013-10-20 15:23:01
 	 * @version 0
	 */	
	struct CGisCoreAoCheckAreaCoverResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::map<uint32_t,uint32_t > CheckResult;
		std::string errMsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return GISCOREAO_CHECKAREACOVER_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & CheckResult;
			bs & errMsg;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	
	/**
	 *
 	 * 获取合并经纬度请求类 
	 *
 	 * @date 2013-10-20 15:23:01
 	 * @version 0
	 */	
	struct CGisCoreAoGetMergeCoordinateReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		std::string destAddrProvince;
		std::string destAddrCity;
		std::string destAddrDistrict;
		std::string destAddrText;
		std::string inReserve;
		erp::gis::po::CMergedCoordinatesPo mergedCoordinatesPo;	
		std::string errMsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return GISCOREAO_GETMERGECOORDINATE_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > GISCOREAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			bs & destAddrProvince;
			bs & destAddrCity;
			bs & destAddrDistrict;
			bs & destAddrText;
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 获取合并经纬度返回类 
	 *
 	 * @date 2013-10-20 15:23:01
 	 * @version 0
	 */	
	struct CGisCoreAoGetMergeCoordinateResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		erp::gis::po::CMergedCoordinatesPo mergedCoordinatesPo;	
		std::string errMsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return GISCOREAO_GETMERGECOORDINATE_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			mergedCoordinatesPo.Serialize(bs);
			bs & errMsg;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	

}
}
}

#endif /* GISCOREAO_STRUCT_H */

